home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Classicos / Arkanoid Flash.swf / scripts / frame_4 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  1.6 KB  |  81 lines

  1. if(started == "0")
  2. {
  3.    gotoAndPlay(50);
  4. }
  5. if(noOfBricks == "0")
  6. {
  7.    gotoAndPlay(62);
  8. }
  9. speed_x = vector_x * magnitude;
  10. speed_y = vector_y * magnitude;
  11. ball_xB = getProperty("/ball", _X);
  12. ball_yB = getProperty("/ball", _Y);
  13. ball_xA = ball_xB;
  14. ball_yA = ball_yB;
  15. ball_xB = ball_xA + speed_x;
  16. ball_yB = ball_yA + speed_y;
  17. if(direction eq "NE")
  18. {
  19.    call("NE");
  20. }
  21. else if(direction eq "NW")
  22. {
  23.    call("NW");
  24. }
  25. else if(direction eq "SE")
  26. {
  27.    call("SE");
  28. }
  29. else if(direction eq "SW")
  30. {
  31.    call("SW");
  32. }
  33. if("410" < ball_xB)
  34. {
  35.    ball_xB = "410" - ballRadius;
  36.    vector_x = - vector_x;
  37. }
  38. if(ball_xB < "10")
  39. {
  40.    ball_xB = "10" + ballRadius;
  41.    vector_x = - vector_x;
  42. }
  43. if(caught == "1")
  44. {
  45.    if(ball_yB == bat_collision_line)
  46.    {
  47.       bat_left = getProperty("/bat", _X) - batWidth / "2";
  48.       bat_right = getProperty("/bat", _X) + batWidth / "2";
  49.       if(ball_xB >= bat_left or bat_right >= ball_xB)
  50.       {
  51.          gotoAndPlay(34);
  52.       }
  53.    }
  54. }
  55. if("400" < ball_yB)
  56. {
  57.    gotoAndPlay(55);
  58. }
  59. point_x1 = getProperty("/ball", _X);
  60. point_y1 = getProperty("/ball", _Y);
  61. setProperty("/ball", _X, ball_xB);
  62. setProperty("/ball", _Y, ball_yB);
  63. point_x2 = getProperty("/ball", _X);
  64. point_y2 = getProperty("/ball", _Y);
  65. if("0" < point_x2 - point_x1 and point_y2 - point_y1 < "0")
  66. {
  67.    direction = "NE";
  68. }
  69. else if("0" < point_x2 - point_x1 and "0" < point_y2 - point_y1)
  70. {
  71.    direction = "SE";
  72. }
  73. else if(point_x2 - point_x1 < "0" and "0" < point_y2 - point_y1)
  74. {
  75.    direction = "SW";
  76. }
  77. else if(point_x2 - point_x1 < "0" and point_y2 - point_y1 < "0")
  78. {
  79.    direction = "NW";
  80. }
  81.